package com.yuan.service;

import com.yuan.dao.UserDao;
import com.yuan.pojo.User;

import java.sql.SQLException;
import java.util.List;

public class UserService {
        private UserDao userDao=new UserDao();
        public User login(String username,String password) throws SQLException {
            User user = userDao.findUser(username, password);
            return user;
        }

        public void register(User user) throws SQLException {
            userDao.instertUser(user);
        }

        public List<User> showUser() throws SQLException {
            return userDao.findUser();
        }

}
